home *** CD-ROM | disk | FTP | other *** search
- Path: nntphost.dur.ac.uk!nntp
- From: Rory Barr <R.J.Barr@durham.ac.uk>
- Newsgroups: comp.lang.c++
- Subject: Templates and linker errors
- Date: Wed, 24 Jan 1996 23:26:50 +0000
- Organization: University of Durham, Durham, UK.
- Message-ID: <3106C03A.6553@durham.ac.uk>
- NNTP-Posting-Host: geotech1.dur.ac.uk
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0b5 (Win95; I)
-
- I am using Borland 4.5. The code I am writing makes quite extensive use
- of container classes. However I have just come across a new error wish I
- just can't get past. With a deadline looming I am desperate for some
- help.
-
- The error occurs on the second pass of the linker and is
-
- Linker Error: Undefined symbol TMISetAsVector<TRCondition,
- TStandardAllocator>::Add(TRCondition far*) in module BLAH.CPP
-
- However if I create a seperate project and create a countainer of
- TRCondition objects and some code that uses Add(T*) it links fine.
-
- The problem appears to be in the creation of template instances.
- TRCondition is not the only class I get this error, and I also get
- similar errors for the functions Detach() and Find(), however some other
- similar classes link fine. If I change the template options
- (Options|Project|C++ options|templates) to get the compliler to
- generate external references to all the instances I get this same error
- for all the classes I've used that container class with. If I set it to
- use global definitions it comes back with hundreds of redefinition
- errors.
-
- Does anybody have any ideas how to get round this problem.
-
- Rory.
-
- please email me as well as posting replies, mailto:R.J.Barr@durham.ac.uk
-